﻿package mortal.game.view.nationalDayAct
{
    import com.mui.containers.globalVariable.*;
    import com.mui.controls.*;
    import extend.language.*;
    import fl.data.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;

    public class nationalDayActOnlinePanel extends nationalDayActBasePanel
    {
        private var _giftList:GTileList;

        public function nationalDayActOnlinePanel()
        {
            super(nationalDayActConst.Act_Online);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActSecondTxt1, 228, 65, this));
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActGiftBagBg, 50, 358, this));
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActRewardTxt, 130 + 151 + 20, 382, this));
            pushUIToDisposeVec(UIFactory.gTextField(Language.getString(90459), 302, 533 - 50 + 40, 380, 40, this, GlobalStyle.textFormatBai.setSize(16), true));
            this._giftList = UIFactory.tileList(109, 415, 500, 80, this);
            this._giftList.columnWidth = 80;
            this._giftList.rowHeight = 80;
            this._giftList.horizontalGap = 0;
            this._giftList.verticalGap = 0;
            this._giftList.setStyle("cellRenderer", nationalDayActGiftCellRender);
            this._giftList.dataProvider = this.getGiftListDataProviderByArray([120101400, 120101401, 120101402, 120101403]);
            this._giftList.direction = GBoxDirection.HORIZONTAL;
            this._giftList.drawNow();
            return;
        }// end function

        private function getGiftListDataProviderByArray(param1:Array) : DataProvider
        {
            var _loc_3:nationalDayActGiftDataGroup = null;
            var _loc_7:Array = null;
            var _loc_2:int = 0;
            var _loc_4:* = new DataProvider();
            var _loc_5:* = new ItemData(int(param1[0])).itemInfo as ItemGiftBagInfo;
            var _loc_6:* = _loc_5.itemList1.split("&");
            _loc_2 = 0;
            while (_loc_2 < _loc_6.length)
            {
                
                _loc_7 = _loc_6[_loc_2].split("#");
                _loc_3 = new nationalDayActGiftDataGroup();
                _loc_3.itemCode = int(_loc_7[1]);
                _loc_3.itemData = new ItemData(int(_loc_7[1]));
                _loc_3.itemAmount = _loc_7[2];
                _loc_3.isBind = true;
                _loc_4.addItem(_loc_3);
                _loc_2++;
            }
            return _loc_4;
        }// end function

        override protected function setDescTxt() : void
        {
            this._actDescTxt.htmlText = Language.getString(90460);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._giftList.dispose(param1);
            this._giftList = null;
            super.disposeImpl(param1);
            return;
        }// end function

    }
}
